Integrand size = 21, antiderivative size = 139 \[ \int \frac {\cos ^4(c+d x)}{(a+b \sin (c+d x))^3} \, dx=-\frac {3 a x}{b^4}+\frac {3 \left (2 a^2-b^2\right ) \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{b^4 \sqrt {a^2-b^2} d}-\frac {\cos ^3(c+d x)}{2 b d (a+b \sin (c+d x))^2}-\frac {3 \cos (c+d x) (2 a+b \sin (c+d x))}{2 b^3 d (a+b \sin (c+d x))} \]
[Out]
Time = 0.15 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2772, 2942, 2814, 2739, 632, 210} \[ \int \frac {\cos ^4(c+d x)}{(a+b \sin (c+d x))^3} \, dx=\frac {3 \left (2 a^2-b^2\right ) \arctan \left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{b^4 d \sqrt {a^2-b^2}}-\frac {3 a x}{b^4}-\frac {3 \cos (c+d x) (2 a+b \sin (c+d x))}{2 b^3 d (a+b \sin (c+d x))}-\frac {\cos ^3(c+d x)}{2 b d (a+b \sin (c+d x))^2} \]
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2772
Rule 2814
Rule 2942
Rubi steps \begin{align*} \text {integral}& = -\frac {\cos ^3(c+d x)}{2 b d (a+b \sin (c+d x))^2}-\frac {3 \int \frac {\cos ^2(c+d x) \sin (c+d x)}{(a+b \sin (c+d x))^2} \, dx}{2 b} \\ & = -\frac {\cos ^3(c+d x)}{2 b d (a+b \sin (c+d x))^2}-\frac {3 \cos (c+d x) (2 a+b \sin (c+d x))}{2 b^3 d (a+b \sin (c+d x))}+\frac {3 \int \frac {-b-2 a \sin (c+d x)}{a+b \sin (c+d x)} \, dx}{2 b^3} \\ & = -\frac {3 a x}{b^4}-\frac {\cos ^3(c+d x)}{2 b d (a+b \sin (c+d x))^2}-\frac {3 \cos (c+d x) (2 a+b \sin (c+d x))}{2 b^3 d (a+b \sin (c+d x))}+\frac {\left (3 \left (2 a^2-b^2\right )\right ) \int \frac {1}{a+b \sin (c+d x)} \, dx}{2 b^4} \\ & = -\frac {3 a x}{b^4}-\frac {\cos ^3(c+d x)}{2 b d (a+b \sin (c+d x))^2}-\frac {3 \cos (c+d x) (2 a+b \sin (c+d x))}{2 b^3 d (a+b \sin (c+d x))}+\frac {\left (3 \left (2 a^2-b^2\right )\right ) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^4 d} \\ & = -\frac {3 a x}{b^4}-\frac {\cos ^3(c+d x)}{2 b d (a+b \sin (c+d x))^2}-\frac {3 \cos (c+d x) (2 a+b \sin (c+d x))}{2 b^3 d (a+b \sin (c+d x))}-\frac {\left (6 \left (2 a^2-b^2\right )\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^4 d} \\ & = -\frac {3 a x}{b^4}+\frac {3 \left (2 a^2-b^2\right ) \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{b^4 \sqrt {a^2-b^2} d}-\frac {\cos ^3(c+d x)}{2 b d (a+b \sin (c+d x))^2}-\frac {3 \cos (c+d x) (2 a+b \sin (c+d x))}{2 b^3 d (a+b \sin (c+d x))} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(486\) vs. \(2(139)=278\).
Time = 6.30 (sec) , antiderivative size = 486, normalized size of antiderivative = 3.50 \[ \int \frac {\cos ^4(c+d x)}{(a+b \sin (c+d x))^3} \, dx=-\frac {\cos ^3(c+d x) \left (-6 \left (2 a^3-2 a^2 b-a b^2+b^3\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \sqrt {-\frac {b (1+\sin (c+d x))}{a-b}}}{\sqrt {a+b} \sqrt {-\frac {b (-1+\sin (c+d x))}{a+b}}}\right ) \sqrt {1-\sin (c+d x)} (a+b \sin (c+d x))^2+\sqrt {a+b} \left (6 \sqrt {a-b} \left (2 a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {\frac {b (1+\sin (c+d x))}{-a+b}}}{\sqrt {-\frac {b (-1+\sin (c+d x))}{a+b}}}\right ) \sqrt {1-\sin (c+d x)} (a+b \sin (c+d x))^2+(-a+b) \sqrt {-\frac {b (-1+\sin (c+d x))}{a+b}} \left (6 \sqrt {b} (2 a+b) \text {arcsinh}\left (\frac {\sqrt {a-b} \sqrt {-\frac {b (1+\sin (c+d x))}{a-b}}}{\sqrt {2} \sqrt {b}}\right ) (a+b \sin (c+d x))^2+\sqrt {a-b} (a+b) \sqrt {1-\sin (c+d x)} \sqrt {\frac {b (1+\sin (c+d x))}{-a+b}} \left (6 a^2+b^2+9 a b \sin (c+d x)+2 b^2 \sin ^2(c+d x)\right )\right )\right )\right )}{2 (a-b)^{5/2} b^2 (a+b)^{3/2} d (1-\sin (c+d x))^{3/2} \sqrt {-\frac {b (-1+\sin (c+d x))}{a+b}} \left (-\frac {b (1+\sin (c+d x))}{a-b}\right )^{3/2} (a+b \sin (c+d x))^2} \]
[In]
[Out]
Time = 1.94 (sec) , antiderivative size = 238, normalized size of antiderivative = 1.71
method | result | size |
derivativedivides | \(\frac {\frac {\frac {2 \left (-\frac {b^{2} \left (3 a^{2}+2 b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {b \left (4 a^{4}+9 a^{2} b^{2}+2 b^{4}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a^{2}}-\frac {b^{2} \left (13 a^{2}+2 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a}-2 a^{2} b -\frac {b^{3}}{2}\right )}{{\left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \right )}^{2}}+\frac {3 \left (2 a^{2}-b^{2}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}}}{b^{4}}-\frac {2 \left (\frac {b}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}+3 a \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}{b^{4}}}{d}\) | \(238\) |
default | \(\frac {\frac {\frac {2 \left (-\frac {b^{2} \left (3 a^{2}+2 b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {b \left (4 a^{4}+9 a^{2} b^{2}+2 b^{4}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a^{2}}-\frac {b^{2} \left (13 a^{2}+2 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a}-2 a^{2} b -\frac {b^{3}}{2}\right )}{{\left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \right )}^{2}}+\frac {3 \left (2 a^{2}-b^{2}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}}}{b^{4}}-\frac {2 \left (\frac {b}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}+3 a \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}{b^{4}}}{d}\) | \(238\) |
risch | \(-\frac {3 a x}{b^{4}}-\frac {{\mathrm e}^{i \left (d x +c \right )}}{2 b^{3} d}-\frac {{\mathrm e}^{-i \left (d x +c \right )}}{2 b^{3} d}+\frac {i \left (-6 i a^{2} b \,{\mathrm e}^{3 i \left (d x +c \right )}+i b^{3} {\mathrm e}^{3 i \left (d x +c \right )}+14 i a^{2} b \,{\mathrm e}^{i \left (d x +c \right )}+i b^{3} {\mathrm e}^{i \left (d x +c \right )}+10 a^{3} {\mathrm e}^{2 i \left (d x +c \right )}+5 a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-5 a \,b^{2}\right )}{\left (-i b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 a \,{\mathrm e}^{i \left (d x +c \right )}+i b \right )^{2} d \,b^{4}}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right ) a^{2}}{\sqrt {-a^{2}+b^{2}}\, d \,b^{4}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a \sqrt {-a^{2}+b^{2}}-a^{2}+b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right )}{2 \sqrt {-a^{2}+b^{2}}\, d \,b^{2}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right ) a^{2}}{\sqrt {-a^{2}+b^{2}}\, d \,b^{4}}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a \sqrt {-a^{2}+b^{2}}+a^{2}-b^{2}}{b \sqrt {-a^{2}+b^{2}}}\right )}{2 \sqrt {-a^{2}+b^{2}}\, d \,b^{2}}\) | \(464\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 316 vs. \(2 (130) = 260\).
Time = 0.32 (sec) , antiderivative size = 716, normalized size of antiderivative = 5.15 \[ \int \frac {\cos ^4(c+d x)}{(a+b \sin (c+d x))^3} \, dx=\left [-\frac {12 \, {\left (a^{3} b^{2} - a b^{4}\right )} d x \cos \left (d x + c\right )^{2} + 4 \, {\left (a^{2} b^{3} - b^{5}\right )} \cos \left (d x + c\right )^{3} - 12 \, {\left (a^{5} - a b^{4}\right )} d x + 3 \, {\left (2 \, a^{4} + a^{2} b^{2} - b^{4} - {\left (2 \, a^{2} b^{2} - b^{4}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (2 \, a^{3} b - a b^{3}\right )} \sin \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}} \log \left (-\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2} - 2 \, {\left (a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}\right ) - 6 \, {\left (2 \, a^{4} b - a^{2} b^{3} - b^{5}\right )} \cos \left (d x + c\right ) - 6 \, {\left (4 \, {\left (a^{4} b - a^{2} b^{3}\right )} d x + 3 \, {\left (a^{3} b^{2} - a b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, {\left ({\left (a^{2} b^{6} - b^{8}\right )} d \cos \left (d x + c\right )^{2} - 2 \, {\left (a^{3} b^{5} - a b^{7}\right )} d \sin \left (d x + c\right ) - {\left (a^{4} b^{4} - b^{8}\right )} d\right )}}, -\frac {6 \, {\left (a^{3} b^{2} - a b^{4}\right )} d x \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{2} b^{3} - b^{5}\right )} \cos \left (d x + c\right )^{3} - 6 \, {\left (a^{5} - a b^{4}\right )} d x - 3 \, {\left (2 \, a^{4} + a^{2} b^{2} - b^{4} - {\left (2 \, a^{2} b^{2} - b^{4}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (2 \, a^{3} b - a b^{3}\right )} \sin \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \sin \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (d x + c\right )}\right ) - 3 \, {\left (2 \, a^{4} b - a^{2} b^{3} - b^{5}\right )} \cos \left (d x + c\right ) - 3 \, {\left (4 \, {\left (a^{4} b - a^{2} b^{3}\right )} d x + 3 \, {\left (a^{3} b^{2} - a b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{2} b^{6} - b^{8}\right )} d \cos \left (d x + c\right )^{2} - 2 \, {\left (a^{3} b^{5} - a b^{7}\right )} d \sin \left (d x + c\right ) - {\left (a^{4} b^{4} - b^{8}\right )} d\right )}}\right ] \]
[In]
[Out]
Timed out. \[ \int \frac {\cos ^4(c+d x)}{(a+b \sin (c+d x))^3} \, dx=\text {Timed out} \]
[In]
[Out]
Exception generated. \[ \int \frac {\cos ^4(c+d x)}{(a+b \sin (c+d x))^3} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 272 vs. \(2 (130) = 260\).
Time = 0.37 (sec) , antiderivative size = 272, normalized size of antiderivative = 1.96 \[ \int \frac {\cos ^4(c+d x)}{(a+b \sin (c+d x))^3} \, dx=-\frac {\frac {3 \, {\left (d x + c\right )} a}{b^{4}} - \frac {3 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )} {\left (2 \, a^{2} - b^{2}\right )}}{\sqrt {a^{2} - b^{2}} b^{4}} + \frac {2}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )} b^{3}} + \frac {3 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 4 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 9 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 13 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 4 \, a^{4} + a^{2} b^{2}}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a\right )}^{2} a^{2} b^{3}}}{d} \]
[In]
[Out]
Time = 7.18 (sec) , antiderivative size = 1360, normalized size of antiderivative = 9.78 \[ \int \frac {\cos ^4(c+d x)}{(a+b \sin (c+d x))^3} \, dx=\text {Too large to display} \]
[In]
[Out]